package cn.bevisoft.casex.dal.dao.impl;

import org.apache.ibatis.session.SqlSession;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;

import cn.bevisoft.casex.dal.dao.DAO;

public abstract class DAOImpl extends SqlSessionDaoSupport implements DAO {

	private static final String	DOT	= ".";
	
	protected String		nameSpace;

	@Autowired
	protected SqlSession	sqlSession;
	
	protected DAOImpl(String nameSpace) {
		this.nameSpace = nameSpace;
	}

	public void setNameSpace(String nameSpace) {
		this.nameSpace = nameSpace;
	}
	
	public String getNameSpace() {
		return nameSpace;
	}
	
	protected String buildSqlId(String sqlId) {
		return new StringBuffer().append(this.nameSpace).append(DOT).append(sqlId).toString();
	}
}
